var arr = pinpai.length;

var str = ''

function xianxuan() {
    str = `
    <li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>


<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>
<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>


<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>
<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>


<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>
<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>
<li>
    <a href="#"><img src="https://x.dscmall.cn/storage/data/indeximg/1490035744332013781.jpg" alt="">
    </a>
    <nav class="PinPaizq_mc">
        <section class="Pinpai_mc">
            <h3>品牌描述</h3>
            <p>暂无描述</p>
        </section>
    </nav>
    <div class="PinPaizq_logo">
        <div class="PinPaizq_yincang">
            <a href="#"> <img src="https://x.dscmall.cn/storage/data/brandlogo/1490072850306019115.jpg"
                    alt=""></a>
        </div>
        <div class="PinPaizq_xianshi">
            <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
        </div>
    </div>
    <div class="slogan">比特</div>
</li>
    
    `
    $('.PinPaizq_Ljzai').children('ul').add().html(str)

} xianxuan()




function xuanran() {
    for (var i = 0; i < arr; i++) {
        str += `
        <li>
        <a href="#"><img src="${pinpai[i].daimg}" alt="">
        </a>
        <nav class="PinPaizq_mc">
            <section class="Pinpai_mc">
                <h3>品牌描述</h3>
                <p>暂无描述</p>
            </section>
        </nav>
        <div class="PinPaizq_logo">
            <div class="PinPaizq_yincang">
                <a href="#"> <img src="${pinpai[i].xiaoimg}"
                        alt=""></a>
            </div>
            <div class="PinPaizq_xianshi">
                <i class="iconfont icon-aixin"></i> <a href="#">关注</a>
            </div>
        </div>
        <div class="slogan">${pinpai[i].text}</div>
    </li>
       `
    }
    $('.PinPaizq_Ljzai').children('ul').html(str)

}
// $('html').on('click', function () {
//     xuanran()
//     console.log(111);
// })
// console.log(str);



$(window).scroll(function () {
    if ($(document).scrollTop() >= $(document).height() - $(window).height() - 10) {
        // alert("滚动条已经到达底部为" + $(document).scrollTop());
        xuanran()
        if ($('.PinPaizq_Ljzai ul').children('li').length == 32) {
            $(window).off()
           
        }
        // console.log($('.PinPaizq_Ljzai ul').children('li').length);
    }
});








